package com.anolesoft.amljmes.restService.controller;

import com.anolesoft.amljmes.restService.service.MesBzzPtmlIerpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/mes/bzz")
public class MesBzzPtmlIerpController {

    @Autowired
    private MesBzzPtmlIerpService service;

    @PostMapping("/ptml")
    @ResponseBody
    @Transactional
    public String getmodel(String model){
        System.out.println(model);
        String result = "";
        int a = service.deletePtmlByJx(model);
        int b = service.insertPtmlByJx(model);
        if (a != 0 && b != 0) {
            result = "成功";
        } else {
            result = "失败";
        }
        return result;
    }
}
